# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=nfcutils
pkgver=61.49aa178
pkgrel=1
groups=('blackarch' 'blackarch-nfc')
pkgdesc='A simple command that lists tags which are in your NFC device field.'
arch=('x86_64' 'aarch64')
url='https://github.com/nfc-tools/nfcutils'
license=('LGPL-3.0-only')
depends=('libnfc>=1.4.0')
makedepends=('git' 'autoconf' 'automake')
source=("git+https://github.com/nfc-tools/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  ( set -o pipefail
    git describe --long --tags --abbrev=7 2>/dev/null |
      sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "%s.%s" "$(git rev-list --count HEAD)" \
      "$(git rev-parse --short=7 HEAD)"
  )
}

prepare() {
  cd $pkgname

  aclocal || true
  autoconf || true
  automake --add-missing || true
  autoreconf || true
}

build() {
  cd $pkgname

  ./configure --prefix=/usr

  make
}

package() {
  cd $pkgname

  make DESTDIR="$pkgdir" install
}

